import request from '@/router/axios';
//查找表格
export const getInforList = (page, size, params) => {
  return request({
    url: '/account/sellerUserAccount/detail',
    method: 'post',
    params: {
      ...params,
    }
  })
}
//查询流水
export const tradeRecordList = (page, size, params) => {
  return request({
    url: '/account/sellerUserAccount/tradeRecordList',
    method: 'post',
    params: {
        ...params,
        page,
        size,
    },
  })
}

//余额充值
export const recharge = (amount) => {
    return request({
        url: '/account/sellerUserAccount/recharge',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            amount:amount
        }
    })
}


//余额充值成功后自动调这个接口
// payFormType 类型：1订单 2积分订单 3用户充值 4店铺充值
export const getPayInfo = (dialogForm,returnCode) => {
    return request({
        url: '/pay/pay/getPayInfo',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            payWay:dialogForm.cashId,
            payFormType:4,//店铺充值
            payIds:returnCode
        }
    })
}

//广告币充值
export const advertRecharge = (dialogForm,accountId) => {
    return request({
        url: '/account/sellerUserAccount/advertRecharge',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
          price:dialogForm.price,
          passWord:dialogForm.passWord,
          accountId:accountId
        }
    })
}

//申请提现
export const withdraw = (dialogForm,accountId) => {
    return request({
        url: '/account/sellerUserAccount/applyWithdraw',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            accountId:accountId,//本账户的Id
            price:dialogForm.price,
            passWord:dialogForm.passWord,
            cashId:dialogForm.cashId,//提现方式的id
            cashAccount:dialogForm.cashAccount, //提现到的账户
            remark: dialogForm.remark,  //体现备注
        }
    })
}

//查询账户日志流水
export const tradeRecordLogList = (page, size, params) => {
    return request({
        url: '/account/sellerUserAccount/listTradeLog',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
}


